<div id="content" class="container_12">
    <div class="grid_12 header-border">
        <?php
            if(count($friendrequest) > 1){
                echo '<input type="button" value="Accept All Friend Request" onClick="anchor(\'\');" id="add-user-button" class="silver-button float-right" />';
            }
        ?>
        <h2>Friend Requests</h2>
    </div>
    <div class="grid_12">
    <?php
    if(count($friendrequest) > 0) {
        foreach($friendrequest as $friend){
          echo '<div class="search-result">';
            if($friend->avatar != null) {
                echo '<img src="'.base_url().'getImg.php?id='.$friend->account_id.'" alt="avatar" class="thumbnail float-left" />';
            } else {
                echo '<img src="'.base_url().'images/unknown_user.jpg" alt="avatar" class="thumbnail float-left" />';
            }
            
            echo '<div class="grid_10">';
            echo '<input type="button" value="Accept Friend Request" onClick="anchor(\''.base_url().'friend/approveRequest?action=accept&id='.$friend->account_id.'&id2='.$this->session->userdata('account_id').'\')" class="silver-button float-right" />';
            echo '<input type="button" value="Decline Friend Request" onClick="anchor(\''.base_url().'friend/rejectRequest?action=reject&id='.$friend->account_id.'&id2='.$this->session->userdata('account_id').'\')" class="silver-button float-right" />';
            echo '<h3><a class="search-link" href="'.base_url().'account/profile?id='.$friend->account_id.'">'.$friend->f_name.' '.$friend->l_name.'</a></h3>';
            echo 'About Me: '.nl2br($friend->about_me);
            echo '</div>';
            echo '<div class="clear"></div>';
          echo '</div>';
        }
        echo '<div class="pagination">Pages:&nbsp;';
        displayPages($totalpage,10);
        echo '</div>';
    }
    
    ?>
    </div>
</div>